# -*- coding:utf8 -*-
# 崔烁豪
# 时间：2021-04-16 12:19
# 用you-get和ffmpeg从爱奇艺批量下载海贼王视频

import sys
import numpy as np
from you_get import common as you_get


# txt文件数据来源方式：
#     https://www.iqiyi.com/a_19rrhb3xvl.html
#     数字选集
#     //li[@class='album_item']/a/@href
#     OK

def get_urls():
    urls = np.loadtxt('./you-get-urls.txt', dtype=str, delimiter=' ')
    for url in urls:
        download("https:" + url)


def download(url):
    try:
        output_dir = r'C:\Users\cuishuohao\Desktop'
        sys.argv = ['you-get', '-o', output_dir, url]
        you_get.main()

    finally:
        "没什么大不了，继续啊"


if __name__ == '__main__':
    get_urls()
